project(SER_DES_USER_NATIVE)

add_library(interop_native_module SHARED interop_native_module.cpp)
target_include_directories(interop_native_module PRIVATE ${ANI_INCLUDE_DIR})
target_include_directories(interop_native_module PRIVATE ${PANDA_HELPERS_SOURCE_DIR})

set(ARKTSCONFIG_PATH "${CMAKE_CURRENT_BINARY_DIR}/arktsconfig.json")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/arktsconfig.json.in" "${ARKTSCONFIG_PATH}")

compile_panda_source_list(
    TARGET_NAME ser_des_user_native_srcs
    SOURCE_LIST
        "InteropNativeModule.ets"
        "StubFastIntrinsics.ets"
        "SerializerBase.ets"
        "DeserializerBase.ets"
    ARKTSCONFIG ${ARKTSCONFIG_PATH}
    ARK_LINK_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/SerDesUserNative.abc"
    EXTRA_DEPS interop_native_module
)
